package com.wp.csmu.classschedule.application;

import android.app.Application;
import android.content.Context;
import android.content.pm.ApplicationInfo;

import com.tencent.bugly.Bugly;

public class MyApplication extends Application {
    private static Context context;

    public static Context getContext() {
        return context;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        context = getApplicationContext();
        Bugly.init(context, "5c75ae62e4", true);
        /*if (isDebug() && !com.squareup.leakcanary.LeakCanary.isInAnalyzerProcess(context)){
            com.squareup.leakcanary.LeakCanary.install(this);
        }*/
    }

    private boolean isDebug() {
        try {
            ApplicationInfo info = context.getApplicationInfo();
            return (info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
        } catch (Exception e) {
            return false;
        }
    }
}
